import java.util.Scanner;
public class Main {
public static void main(String args[]) {
      Scanner input = new Scanner(System.in);
          int[] a = new int[10];
            for(int i=0;i<a.length;i++) {
              a[i] = input.nextInt();
            }
                  int b = 0;
                  int chang = a.length;
                  for(int i=0;i<chang-1;i++) {
                  for(int j=0;j<chang-1-i;j++) {
              if(a[j] > a[j+1]) {
                  b = a[j];
                  a[j] = a[j+1];
                  a[j+1] = b;
              }
          }
      }
          System.out.print("max="+a[a.length-1]+","+"cmax="+a[a.length-2]);
      }
}